package com.coolwen.spring.speciality.dto;

import com.coolwen.spring.speciality.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author CoolWen
 * @version 2020-04-09 9:18
 */
@Component
public class StudentDto {
    @Autowired
    private Student student;

    @Value("#{student.name}")
    private String name;

    @Value("#{student.books.size()}")
    private int count;

    @Value("#{student.books.![name]}")
    private List<String> bookName;

    @Value("#{T(com.coolwen.spring.speciality.util.BookUtil).calPrice(student.books)}")
    private double price;


    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public List<String> getBookName() {
        return bookName;
    }

    public void setBookName(List<String> bookName) {
        this.bookName = bookName;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
}
